package com.ch01;

import java.util.stream.IntStream;

public class MinDemo {
	
	public static void main(String[] args) {
		int[] nums = {12,34,55,-2,32,60};
		//函数式编程
		/**
		 * parallel() 并行
		 */
		int min = IntStream.of(nums).parallel().min().getAsInt();
		System.out.println(min);
		int max = IntStream.of(nums).parallel().max().getAsInt();
		System.out.println(max);
		int sum = IntStream.of(nums).parallel().sum();
		System.out.println(sum);
		long count = IntStream.of(nums).sequential().count();
		System.out.println(count);
	}
}
